<%@LANGUAGE="VBSCRIPT"%>
 
<!--#include file="functions.asp" -->
<% dim tmpSQL
   if (request.querystring("InvStatus") <> "0") then
   tmpSQL=" AND INVSTATUS='"& request.querystring("InvStatus") & "'"
   'else
   'tmpSQL=" AND (INVSTATUS = 'PARKED' OR INVSTATUS = 'ROUTED' OR INVSTATUS = 'PREAPPROVED' OR INVSTATUS = 'APPROVED')"
   end if
   
   if (request.querystring("CurSymbol") <> "N") then
   tmpSQL= tmpSQL & " AND CURRENCYSYMBOL='"& request.querystring("CurSymbol") & "'"
   end if
   
   if (request.querystring("RegNum") <> "N") then
   tmpSQL= tmpSQL & " AND REGNUM LIKE '%"& request.querystring("RegNum") & "%'"
   end if
   
   
   if (request.querystring("Location") <> "") then
   tmpSQL= tmpSQL & " AND LOCATION='"& request.querystring("location") & "'"
   end if
   
   if (request.querystring("UserCoord") <> "") then
   tmpSQL= tmpSQL & " AND USERCOORD='"& request.querystring("UserCoord") & "'"
   end if
   
   if (request.querystring("VendorID") <> "") then
   tmpSQL= tmpSQL & " AND VENDORID='"& request.querystring("VendorID") & "'"
   end if
   
   if (request.querystring("RefOrder") <> "0") then
   tmpSQL= tmpSQL & " AND REFORDER='"& request.querystring("RefOrder") & "'"
   end if
   
   if (Request.QueryString("RecDate") <> "") Then
   Select Case Request.QueryString("RptCond")
    Case 1
     tmpSQL = tmpSQL & " AND CONVERT(CHAR(10),INVRECDATE,101) = '" & Request.QueryString("RecDate") & "'"
	Case 2
	 tmpSQL = tmpSQL & " AND INVRECDATE <= CONVERT(DATETIME,'" & Request.QueryString("RecDate") & "',101)"
	Case 3
	 tmpSQL = tmpSQL & " AND INVRECDATE >= CONVERT(DATETIME,'" & Request.QueryString("RecDate") & "',101)"
	Case 4
	 tmpSQL = tmpSQL & " AND INVRECDATE BETWEEN '" & Request.QueryString("RecDate") & "' AND '" & Request.QueryString("RecDate2") & "'"
   End Select
   End If

   
   dim tmpSort
   tmpSort="SEQNUM"
   if (request.querystring("dSort") <> "") then
   tmpSort= request.querystring("dSort")
   end if
   
   dim tmpOrder
   tmpOrder = "ASC"
   if (request.QueryString("dOrder") <>"") then
   tmpOrder= request.QueryString("dOrder")
   end if
   Dim CurrOrder
   if (tmpOrder = "ASC" )then 
   CurrOrder ="DESC"
   else
   CurrOrder="ASC"
   end if
%>
<%
set EXIREG = Server.CreateObject("ADODB.Recordset")
EXIREG.ActiveConnection = cn
EXIREG.Source = "SELECT SEQNUM, REGNUM, REFORDER, INVNUM, VENDORID, INVSTATUS, INVAMOUNT, CURRENCYSYMBOL, INVRECDATE, INVDUEDATE,  (SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME  FROM dbo.EXIREG  WHERE REGNUM IS NOT NULL  " & tmpSQL & " ORDER BY " & tmpSort & " " & tmpOrder 
'EXIREG.CursorType = 0
'EXIREG.CursorLocation = 2
'EXIREG.LockType = 3
EXIREG.Open()
EXIREG_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 18
Dim Repeat1__index
Repeat1__index = 0
EXIREG_numRows = EXIREG_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
EXIREG_total = EXIREG.RecordCount

' set the number of rows displayed on this page
If (EXIREG_numRows < 0) Then
  EXIREG_numRows = EXIREG_total
Elseif (EXIREG_numRows = 0) Then
  EXIREG_numRows = 1
End If

' set the first and last displayed record
EXIREG_first = 1
EXIREG_last  = EXIREG_first + EXIREG_numRows - 1

' if we have the correct record count, check the other stats
If (EXIREG_total <> -1) Then
  If (EXIREG_first > EXIREG_total) Then EXIREG_first = EXIREG_total
  If (EXIREG_last > EXIREG_total) Then EXIREG_last = EXIREG_total
  If (EXIREG_numRows > EXIREG_total) Then EXIREG_numRows = EXIREG_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (EXIREG_total = -1) Then

  ' count the total records by iterating through the recordset
  EXIREG_total=0
  While (Not EXIREG.EOF)
    EXIREG_total = EXIREG_total + 1
    EXIREG.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (EXIREG.CursorType > 0) Then
    EXIREG.MoveFirst
  Else
    EXIREG.Requery
  End If

  ' set the number of rows displayed on this page
  If (EXIREG_numRows < 0 Or EXIREG_numRows > EXIREG_total) Then
    EXIREG_numRows = EXIREG_total
  End If

  ' set the first and last displayed record
  EXIREG_first = 1
  EXIREG_last = EXIREG_first + EXIREG_numRows - 1
  If (EXIREG_first > EXIREG_total) Then EXIREG_first = EXIREG_total
  If (EXIREG_last > EXIREG_total) Then EXIREG_last = EXIREG_total

End If
%>
<%
' *** Move To Record and Go To Record: declare variables

Set MM_rs    = EXIREG
MM_rsCount   = EXIREG_total
MM_size      = EXIREG_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  r = Request.QueryString("index")
  If r = "" Then r = Request.QueryString("offset")
  If r <> "" Then MM_offset = Int(r)

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  i = 0
  While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    i = i + 1
  Wend
  If (MM_rs.EOF) Then MM_offset = i  ' set MM_offset to the last possible record

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

  ' walk to the end of the display range for this page
  i = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
    MM_rs.MoveNext
    i = i + 1
  Wend

  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = i
    If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
  End If

  ' if we walked off the end, set the offset based on page size
  If (MM_rs.EOF And Not MM_paramIsDefined) Then
    If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
      If ((MM_rsCount Mod MM_size) > 0) Then
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If

  ' move the cursor to the selected record
  i = 0
  While (Not MM_rs.EOF And i < MM_offset)
    MM_rs.MoveNext
    i = i + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
EXIREG_first = MM_offset + 1
EXIREG_last  = MM_offset + MM_size
If (MM_rsCount <> -1) Then
  If (EXIREG_first > MM_rsCount) Then EXIREG_first = MM_rsCount
  If (EXIREG_last > MM_rsCount) Then EXIREG_last = MM_rsCount
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    params = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For i = 0 To UBound(params)
      nextItem = Left(params(i), InStr(params(i),"=") - 1)
      If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & params(i)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast  = urlStr & "-1"
MM_moveNext  = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev  = urlStr & Cstr(prev)
%>
<SCRIPT Language="JavaScript">
var InvStatus='<%= request.querystring("InvStatus") %>';
var dsort='<%= request.querystring("dsort") %>';
var dorder='<%= request.querystring("dorder") %>';
var Location='<%= request.querystring("Location") %>';
var UserCoord='<%= request.querystring("UserCoord") %>';
var RefOrder='<%= request.querystring("refOrder") %>';
var VendorID='<%= request.querystring("VendorID") %>';
var CurSymbol='<%= request.querystring("CurSymbol") %>';
var RecDate='<%= request.querystring("RecDate") %>';
var RecDate2='<%= request.querystring("RecDate2") %>';
var RptCond='<%= request.querystring("RptCond") %>';
var RegNum='<%= request.querystring("RegNum") %>';

function DocLoad(){

}


<!--
function DoSort(dtsort,dtorder) {
//alert (link.id);
//location = link.href;
document.form1.dsort.value=dtsort;
document.form1.dorder.value=dtorder;
document.form1.submit();
return false;
}
// -->
function redirect(which){
location='Inv_Detail.asp?seqnum='+which+'&InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}

function register(){
location='Inv_Register.asp?InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}

function doClear(){
location='InvList.asp?InvStatus=0&RefOrder=0&CurSymbol=N';
return false
}

function doSearch(){
var Reg=document.form1.RegNum.value;
if (Reg==""){
location='InvSearch.asp?InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
}
else{
location='InvList.asp?RegNum='+Reg+'&InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;}
return false
}
</SCRIPT>
<!-- #include file="pagetop.asp" -->

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td nowrap height="21" bgcolor="#FFFFFF" width="3%" background="images/menu_end.gif">&nbsp;</td>
    <td nowrap height="21" bgcolor="#FFFFFF" width="28"> 
      <div align="center"><img src="images/menu_awal_on.gif" width="28" height="33"></div>
    </td>
    <td width="10%" background="images/menuon.gif" height="21" nowrap> 
      <div align="center"><b class="menu">Service Acceptance List</b></div>
    </td>
    <td nowrap height="21" width="28"><img src="images/menu_on_off_separator.gif" width="28" height="33"></td>
    <td width="10%" background="images/menuoff.gif" height="21" nowrap> 
      <div align="center"><b><a href="#" class="menu" onClick="return register()">Register Service Accceptance</a></b></div>
    </td>
    <td height="21" bgcolor="#FFFFFF" width="11"><img src="images/Menu_offend.gif" width="11" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" background="images/menu_end.gif"> 
      <div align="right"><b></b></div>
    </td>
  </tr>
  <tr bgcolor="#93bee2"> 
    <td height="21" width="3%" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28" bgcolor="#93bee2">&nbsp;</td>
    <td width="10%" height="21" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28">&nbsp;</td>
    <td width="10%" height="21">&nbsp;</td>
    <td height="21">&nbsp;</td>
    <td height="21">&nbsp;</td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#93bee2">
  <tr> 
    <td width="4%" height="26">&nbsp;</td>
    <td width="2%" height="26">&nbsp;</td>
    <td height="26"> 
      <table border="0" width="100%" align="left">
        <tr> 
          <td width="23%" align="center"> <b> 
            <% If MM_offset <> 0 Then %>
            <a href="<%=MM_moveFirst%>">&lt;&lt; 
            First</a> 
            <% End If ' end MM_offset <> 0 %>
            </b></td>
          <td width="31%" align="center"> <b> 
            <% If MM_offset <> 0 Then %>
            <a href="<%=MM_movePrev%>">&lt; 
            Previous</a> 
            <% End If ' end MM_offset <> 0 %>
            </b></td>
          <td width="23%" align="center"> <b> 
            <% If Not MM_atTotal Then %>
            <a href="<%=MM_moveNext%>">Next 
            &gt; </a> 
            <% End If ' end Not MM_atTotal %>
            </b></td>
          <td width="23%" align="center"> <b> 
            <% If Not MM_atTotal Then %>
            <a href="<%=MM_moveLast%>">Last 
            &gt;&gt; </a> 
            <% End If ' end Not MM_atTotal %>
            </b></td>
        </tr>
      </table>    </td>
    <td height="26" width="50%">
      <form name="form1" action="InvList.asp" method="get">
        <div align="right">Search Service Acceptance No: 
          <input type="text" name="RegNum" class="InputBox" size="15" value="<%= request.querystring("regnum") %>">
          <input type="hidden" name="Location" value="<%= request.querystring("Location") %>">
          <input type="hidden" name="InvStatus" value="<%= request.querystring("InvStatus") %>">
          <input type="hidden" name="UserCoord" value="<%= request.querystring("UserCoord") %>">
          <input type="hidden" name="RefOrder" value="<%= request.querystring("RefOrder") %>">
          <input type="hidden" name="VendorID" value="<%= request.querystring("VendorID") %>">
          <input type="hidden" name="CurSymbol" value="<%= request.querystring("CurSymbol") %>">
          <input type="hidden" name="dsort" value="<%= Request.querystring("dsort") %>">
          <input type="hidden" name="dorder" value="<%= Request.querystring("dorder") %>">
          &nbsp; 
          <input type="hidden" name="RecDate" value="<%= request.querystring("RecDate") %>">
          <input type="hidden" name="RecDate2" value="<%= request.querystring("RecDate2") %>">
          <input type="hidden" name="RptCond" value="<%= request.querystring("RptCond") %>">
          &nbsp;
          <input type="button" name="Button2" value="  Search...  " onClick="return doSearch()" class="sbttn">
          <input type="button" name="Button" value="Clear Search" onClick="return doClear()" class="sbttn">
          &nbsp;&nbsp; </div>
        </form>    </td>
  </tr>
  <tr> 
    <td width="4%" height="22">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF" height="22"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF" height="22" colspan="2"><font color="#990000"><b>&nbsp; 
      Records <%=(EXIREG_first)%> to <%=(EXIREG_last)%> of <%=(EXIREG_total)%> </b></font></td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF" colspan="2"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#999999">
        <tr valign="middle" bgcolor="#D1DDEF"> 
          <td width="4%" height="25"> 
            <div align="center"><font color="#000066"><b>No.</b></font></div>          </td>
          <td width="9%" height="25"> 
            <div align="center"><font color="#000066"><b><a href="#" class="menu" onClick="return DoSort('SEQNUM','<%= CurrOrder %>')">Service Acceptance 
              No</a> 
              <% if (tmpSort="SEQNUM") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td width="10%" height="25"> 
            <div align="center"><font color="#000066"><b>Invoice No.</b></font></div>          </td>
          <td width="8%" height="25"> 
            <div align="center"><font color="#000066"><b><a href="#" class="menu" id="recDate" onClick="return DoSort('INVRECDATE','<%= CurrOrder %>')">Recv. 
              Date</a> 
              <% if (tmpSort="INVRECDATE") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td width="8%" height="25"> 
            <div align="center"><font color="#000066"><b><a href="#" class="menu" onClick="return DoSort('INVDUEDATE','<%= CurrOrder %>')">Due 
              Date</a> 
              <% if (tmpSort="INVDUEDATE") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td width="5%" height="25"> 
            <div align="center"><font color="#000066"><b>Curr.</b></font></div>          </td>
          <td width="12%" height="25"> 
            <div align="center"><font color="#000066"><b><a href="#" class="menu" onClick="return DoSort('INVAMOUNT','<%= CurrOrder %>')">Amount</a> 
              <% if (tmpSort="INVAMOUNT") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td height="25" bgcolor="#D1DDEF"> 
            <div align="center"><font color="#000066"><b><a href="#" class="menu" onClick="return DoSort('VENDORID','<%= CurrOrder %>')">Vendor</a> 
              <% if (tmpSort="VENDORID") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td width="5%" height="25"> 
            <div align="center"><b><font color="#000066">Ref.</font></b></div>          </td>
          <td width="12%" height="25"> 
            <div align="center"><font color="#000066"><b><b>Status</b></b></font></div>          </td>
        </tr>
        <% dim Incr
		   Incr = 1 %>
        <% 
While ((Repeat1__numRows <> 0) AND (NOT EXIREG.EOF)) 
%>
        <% if ((Incr mod 2 ) <> 0 ) Then %>
        <tr bgcolor="#FFFFFF"> 
          <td width="4%" height="20"> 
            <div align="right"><%= Incr + EXIREG_first-1%>.&nbsp;</div>          </td>
          <td width="9%" height="20"> 
            <div align="center"><b><a href="#" onClick="return redirect(<%=(EXIREG.Fields.Item("SEQNUM").Value)%>)"><%=(EXIREG.Fields.Item("REGNUM").Value)%></a></b></div>          </td>
          <td width="10%" height="20"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
          <td width="8%" height="20"> 
            <div align="center"><%= DoDateTime((EXIREG.Fields.Item("INVRECDATE").Value), 2, 2070) %></div>          </td>
          <td width="8%" height="20"> 
            <div align="center"><%= DoDateTime((EXIREG.Fields.Item("INVDUEDATE").Value), 2, 2070) %></div>          </td>
          <td width="5%" height="20"> 
            <div align="center"><%=(EXIREG.Fields.Item("CURRENCYSYMBOL").Value)%></div>          </td>
          <td width="12%" height="20"> 
            <div align="right"><%= FormatNumber((EXIREG.Fields.Item("INVAMOUNT").Value), -1, -2, -2, -1) %></div>          </td>
          <td height="20"><%=(EXIREG.Fields.Item("VENDORNAME").Value)%></td>
          <td width="5%" height="20"> 
            <div align="center"><%=(EXIREG.Fields.Item("REFORDER").Value)%></div>          </td>
          <td width="12%" height="20"> 
            <div align="center"><%=(EXIREG.Fields.Item("INVSTATUS").Value)%></div>          </td>
        </tr>
        <% else %>
        <tr bgcolor="#eeeeee"> 
          <td width="4%" height="21"> 
            <div align="right"><%= Incr + EXIREG_first-1%>.&nbsp;</div>          </td>
          <td width="9%" height="21"> 
            <div align="center"><b><a href="#" onClick="return redirect(<%=(EXIREG.Fields.Item("SEQNUM").Value)%>)"><%=(EXIREG.Fields.Item("REGNUM").Value)%></a></b></div>          </td>
          <td width="10%" height="21"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
          <td width="8%" height="21"> 
            <div align="center"><%= DoDateTime((EXIREG.Fields.Item("INVRECDATE").Value), 2, 2070) %></div>          </td>
          <td width="8%" height="21"> 
            <div align="center"><%= DoDateTime((EXIREG.Fields.Item("INVDUEDATE").Value), 2, 2070) %></div>          </td>
          <td width="5%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("CURRENCYSYMBOL").Value)%></div>          </td>
          <td width="12%" height="21"> 
            <div align="right"><%= FormatNumber((EXIREG.Fields.Item("INVAMOUNT").Value), -1, -2, -2, -1) %></div>          </td>
          <td height="21"><%=(EXIREG.Fields.Item("VENDORNAME").Value)%></td>
          <td width="5%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("REFORDER").Value)%></div>          </td>
          <td width="12%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("INVSTATUS").Value)%></div>          </td>
        </tr>
        <% end if %>
        <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Incr = Incr + 1
  EXIREG.MoveNext()
Wend
%>
      </table>    </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF" colspan="2">&nbsp;</td>
  </tr>
</table>

</body>
</html>
<%
EXIREG.Close()
%>
